<?php
class SkipcarController extends Yaf_Controller_Abstract{
	const NET_OK = 10;
	const NET_NOAUTH = 20;
	public function init(){
		$user = cookie::get('user');
		if(!$user){
			$this->redirect('/index/login/');
		}
		Yaf_Loader::import('import.php');
	}
	/**
	 * 料车首页
	 * @method indexAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function indexAction(){
		
	}
	/**
	 * 料车添加
	 * @method addSkipCarAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function addSkipCarAction(){
		$matchAgv = net::inst('autoBG')->matchAgvInit();
		var_dump($matchAgv);
		if(isset($matchAgv->ret)&&$matchAgv->ret == self::NET_OK){
			$this->getView()->assign('agvDetail',$matchAgv->list[0]);
		}else if(isset($matchAgv->ret)&&$matchAgv->ret == self::NET_NOAUTH){
			$this->getView()->assign('error',$matchAgv->msg);
		}else{
			$this->getView()->assign('error','服务器连接错误！');
		}
		$floor = net::inst('autoBG')->pointFloorSelect();
		if(isset($floor->ret)&&$floor->ret == self::NET_OK){
			$this->getView()->assign('floorDetail',$floor->list);
		}else if(isset($floor->ret)&&$floor->ret == self::NET_NOAUTH){
			$this->getView()->assign('error',$result->msg);
		}else{
			$this->getView()->assign('error','服务器连接错误!');
		}
	}
	/**
	 * 料车编辑
	 * @method skipCarEditAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function skipCarEditAction(){

	}
	/**
	 * 料车详情
	 * @method skipCarDetailAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function skipCarDetailAction(){

	}
}